package com.ibeetl.admin.core.web;

import javax.servlet.http.HttpServletRequest;

import com.ibeetl.cms.entity.CmsArticle;
import com.ibeetl.cms.service.CmsArticleService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ibeetl.admin.core.file.FileService;
import com.ibeetl.admin.core.service.*;

/**
 * CoreLog 接口
 */
@Controller
public class CoreLogController{

    private final Log log = LogFactory.getLog(this.getClass());
    private static final String MODEL = "/core/coreLog";


    @Autowired private CoreLogService coreLogService;
    
    @Autowired
    FileService fileService;
    @Autowired
    CmsArticleService articleService;
    /* 页面 */

    @PostMapping(MODEL + "/log.do")
    @ResponseBody
    public JsonResult zan(HttpServletRequest request, @RequestParam(value = "aId", required = true) Long aId) {
    	
    	CmsArticle article = this.articleService.queryById(aId);
    	
    	if (article == null) return new JsonResult<>().fail();
    	
    	return JsonResult.success();
    }
   
}
